<!--
 * @Description: 
 * @Version: 
 * @Autor: kkz <keke.zhang@seaboxdata.com>
 * @Date: 2024-03-06 17:55:23
 * @LastEditors: kkz
 * @LastEditTime: 2024-03-12 16:36:36
-->
<script setup>
import request from '@/utils/request'
import { ref } from 'vue'

defineProps({
  modelValue: {
    type: [Number, String]
  },
  width: {
    type: String
  }
})

const emit = defineEmits(['update:modelValue'])

const channelList = ref([])
const getChannelList = async () => {
  // const res = await artGetChannelsService()
  request
    .post('/organization/page', {
      organizationName: '',
      pageQuery: {
        limit: 99999,
        page: 1
      }
    })
    .then((res) => {
      channelList.value = res.data
    })
}
getChannelList()
</script>

<template>
  <!-- el-select 下拉菜单 -->
  <el-select
    style="width: 240px"
    :modelValue="modelValue"
    clearable
    @update:modelValue="emit('update:modelValue', $event)"
    :style="{ width }"
  >
    <el-option
      v-for="channel in channelList"
      :key="channel.id"
      :label="channel.organizationName"
      :value="channel.id"
    ></el-option>
  </el-select>
</template>
